﻿namespace Identity.Searcher
{
    public class Pager
    {
        private int? _page = 1;

        public int? Page
        {
            get => _page <= 0 ? 1 : _page;
            set => _page = value;
        }

        public int? PageSize { get; set; } = 30;

        public int GetTake()
        {
            return PageSize ?? 30;
        }

        public int GetSkip()
        {
            var result = ((Page ?? 1) - 1) * PageSize ?? 30;
            return result;
        }
    }
}